package concurrency;

/**
 * This is given to the waiter, who gives it to the chef
 * A data-transfer object
 */
class Order {
    private static int sCounter = 0;
    
    private final int mId = sCounter++;
    
    private final Customer mCustomer;
    
    private final WaitPerson mWaitPerson;
    
    private final Food mFood;
    
    public Order(Customer cust, WaitPerson wp, Food f) {
        mCustomer = cust;
        mWaitPerson = wp;
        mFood = f;
    }
    
    public Customer getCustomer() {
        return mCustomer;
    }

    public Food item() {
        return mFood;
    }

    public WaitPerson getWaitPerson() {
        return mWaitPerson;
    }
    
    @Override
    public String toString() {
        return "Order: " + mId + " item: " + mFood + " for: " + mCustomer
                + " served by: " + mWaitPerson;
    }
}
